package com.tbit.uqbike.center.constant;

import com.tbit.uqbike.center.pojo.*;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 系统数据
 *
 * @author Leon
 * 2017年3月8日 下午5:11:40
 */
public class SystemData {

    /**
     * 设备编号到设备id哈希
     */
    public static Map<String, Integer> machineNOMachineIdMap = new ConcurrentHashMap<String, Integer>();

    /**
     * 设备最后状态哈希
     */
    public static Map<Integer, MachineStatus> machineStatusMap = new ConcurrentHashMap<Integer, MachineStatus>();

    /**
     * 设备id到代理商id哈希
     */
    public static Map<Integer, Integer> machineIdAccountIdMap = new ConcurrentHashMap<Integer, Integer>();

    /**
     * 上一次设备数据同步时间
     */
    public static Long lastSynTime = null;

    /**
     * 最大设备id
     */
    public static Integer maxMachineId = null;


    /**
     * 设备Id、电池方案id哈希表
     */
    public static Map<Integer, Integer> machineIdBatteryModelIdMap = new HashMap<Integer, Integer>();

    /**
     * 设备Id、辅电池方案id哈希表
     */
    public static Map<Integer, Integer> machineIdSecondaryBatteryModelIdMap = new HashMap<Integer, Integer>();

    /**
     * 电池方案Id、详情哈希
     */
    public static Map<Integer, List<BatteryModelDetail>> batteryModelListMap = new HashMap<Integer, List<BatteryModelDetail>>();

    /**
     * 电池方案哈希
     */
    public static Map<Integer, BatteryModel> batteryModelMap = new HashMap<Integer, BatteryModel>();

    /**
     * 电量更新设备列表
     */
    public static Map<Integer, Integer> needUpdateBatteryMap = new ConcurrentHashMap<Integer, Integer>();

    /**
     * 设备电压
     */
    public static Map<String, TerAttrEx> lithiumMap = new ConcurrentHashMap<String, TerAttrEx>();


    public static volatile Map<Integer, AccountConfigExt> AccountConfigExtMap = new HashMap<>();


    /**
     * 设备电量信息
     */
    public static Map<Integer, LinkedList<MachineBattery>> machineBatteryMap = new ConcurrentHashMap<Integer, LinkedList<MachineBattery>>();

    /**
     * 设备id到云电池编号哈希
     */
    public static Map<Integer, String> machineIdBatteryMap = new ConcurrentHashMap<>();

    /**
     * 设备id到设备信息哈希
     */
    public static Map<Integer, MachineBase> machineIdMachineMap = new ConcurrentHashMap<>();
}
